import '../../../lib_rtc/rtc/rtm_manager.dart';
import 'rtm_mixin.dart';

class AgoraRtm with RtmMixin {
  @override
  Future<void> initRtm() => RtmManager.instance
      .init(rtmConfig.rtmToken, currUser?.id ?? 0, rtmConfig.channelId);

  @override
  Future<void> loginRtm(String rtmToken) =>
      RtmManager.instance.loginRtmChannel(rtmToken);

  @override
  Future<void> publishRtm(String msg) => RtmManager.instance.publish(msg);

  @override
  Future<void> subscribeRtm() => RtmManager.instance.subscribe();

  @override
  Future<void> leaveRtmChannel() => RtmManager.instance.leaveRtmChannel();
}
